package com.lvmama.rhino.enums;

/**
 * @Author:caoyong
 * @Description: 专题pv类型枚举
 * @Date：2017/10/16
 */
public enum TopicPVTypeEnum {
    TOPIC_PAGE_SUM(1,"进入专题pv"),
    DETAIL_PAGE_SUM(2,"详情页pv"),
    FILL_ORDER_PAGE_SUM(3,"下单pv"),
    PENDING_PAYMENT_PAGE_SUM(4,"待支付pv"),
    COMPLETED_PAYMENT_PAGE_SUM(5,"支付完成pv");

    TopicPVTypeEnum(Integer code, String name) {
        this.code = code;
        this.name = name;
    }

    private Integer code;
    private String name;

    public Integer getCode() {
        return code;
    }

    public String getName() {
        return name;
    }

    /**
     * 获取枚举
     * @param code
     * @return
     */
    public static TopicPVTypeEnum getEnum(Integer code){
        for (TopicPVTypeEnum en : TopicPVTypeEnum.values()){
            if(en.getCode().equals(code)){
                return en;
            }
        }
        return null;
    }
}
